package com.huawei.hwCloudJs.service.http;

import android.content.Context;
import android.util.Log;
import com.huawei.secure.android.common.ssl.SecureSSLSocketFactory;
import javax.net.ssl.HttpsURLConnection;

public class c {
    private static final String a = "HttpsSetting";

    public static void a(HttpsURLConnection httpsURLConnection, Context context) {
        if (httpsURLConnection == null || context == null) {
            Log.e(a, "init https ssl socket null.");
            return;
        }
        try {
            httpsURLConnection.setSSLSocketFactory(SecureSSLSocketFactory.getInstance(context.getApplicationContext()));
            httpsURLConnection.setHostnameVerifier(SecureSSLSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
        } catch (Exception e) {
            Log.e(a, "init https ssl socket failed." + e.getMessage());
        }
    }
}
